package org.jeecg.tender.taskJob.cg11185.support;

import org.jeecg.common.util.DateUtils;
import org.jeecg.tender.information.entity.TenderInformation;

import java.util.Date;

public class BuildTenderInfo {

    public static TenderInformation buildTenderInfo(String title, String projectCode,
                                                    String type, String pubDate,
                                                    String endDate, Long detailId) {
        TenderInformation info = new TenderInformation();
        info.setBiddingNum(projectCode);
        info.setStartTime(DateUtils.parseDate(pubDate, "yyyy/MM/dd"));
        info.setTenderDate(info.getStartTime());
        info.setEndTime(DateUtils.parseDate(endDate, "yyyy-MM-dd HH:mm"));
        info.setTenderTitle(title);
        info.setTenderDesc(String.valueOf(detailId));
        info.setTenderDescType("pdf");
        info.setTenderType(type);
        info.setWebsiteName("中国邮政采购平台");
        info.setCrawlTime(new Date());
        info.setCreateBy("system");
        info.setCreateTime(new Date());
        info.setUpdateTime(new Date());
        return info;
    }

}
